package com.wiscamp.ninechapters.panels.infrastructure.converters;


import com.wiscamp.ninechapters.panels.domain.entities.Organization;
import com.wiscamp.ninechapters.panels.infrastructure.po.OrganizationPO;
import com.wiscamp.ninechapters.panels.infrastructure.views.OrganizationView;
import org.mapstruct.*;
import org.mapstruct.factory.Mappers;

@Mapper(componentModel = "spring",
        unmappedTargetPolicy = ReportingPolicy.IGNORE,
        unmappedSourcePolicy = ReportingPolicy.IGNORE,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
        nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface OrganizationConverter {
    OrganizationConverter Instance = Mappers.getMapper(OrganizationConverter.class);

    Organization toOrganization(OrganizationPO po);

    Organization toOrganizationByView(OrganizationView view);

    OrganizationPO toOrganizationPO(Organization entity);

    OrganizationPO toOrganizationPO(Organization entity, @MappingTarget OrganizationPO po);

}
